package com.weishaoying.thrift.learn.service;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class Main {

    private static final Logger logger = LoggerFactory.getLogger(Main.class);

    public static void main(String[] args) {
//        test();

        System.out.println("-----begin");
        BeanFactory beanFactory = new ClassPathXmlApplicationContext("server.xml");
        System.out.println("-----ApplicationContext started");
    }

    private static void test() {
        //复制3次Java
        List<String> list1 = new ArrayList<>(Collections.nCopies(3, "Java"));
        System.out.println("list1 = " + list1);

        List<String> list2 = new ArrayList<String>() {
            private static final long serialVersionUID = -8010046758793450300L;

            {
                add("Java");
                add("Python");
                add("Go");
            }
        };
        System.out.println("list2 = " + list2);

        List<String> list3 = new ArrayList<>(Arrays.asList("Java", "Ruby", "C", "JS"));
        System.out.println("list3 = " + list3);
    }
}
